package com.wctj.api.base.enums;

/**
 * @author: lzg
 * @description: Recharge 充值，settlement 结算，Withdrawal of cash 取现
 */
public enum PayBusinessTypeEnums {
    RECHANGE(1, "充值", EventTypeEnums.payment)
    ,SETTLEMENT(2, "结算", EventTypeEnums.payment)
    ,WITHDRAWAL(3, "取现", EventTypeEnums.cash)
    ,TRANSFER(4, "支付转账", EventTypeEnums.payment)
    ;

    private Integer code;
    private String msg;
    private EventTypeEnums eventType;

    PayBusinessTypeEnums(int code, String message, EventTypeEnums eventType) {
        this.code = code;
        this.msg = message;
        this.eventType = eventType;
    }
    public Integer getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }

    public static PayBusinessTypeEnums of(int code) {
        for (PayBusinessTypeEnums apiCode : PayBusinessTypeEnums.values()) {
            if (apiCode.getCode() == code) {
                return apiCode;
            }
        }
        return null;
    }

    public EventTypeEnums getEventType() {
        return eventType;
    }
}

